<%@ page language="java" import="java.util.*" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@include file="/inc/taglibs.jsp" %>
<style>
.nolooked{font-weight:bold;}
</style>
<script>
$(function (){
	var $sendtype=$("#sendtype");
	$sendtype.append("<option value=''>发送类型</option>");
	for(var i=0;i<sendtypelist.length;i++){
		$sendtype.append("<option value='"+i+"'>"+sendtypelist[i]+"</option>");
	}
//	var $sendstat=$("#sendstat");
//	$sendstat.append("<option value=''>状态</option>");
//	for(var i=0;i<sendstatlist.length;i++){
//		$sendstat.append("<option value='"+i+"'>"+sendstatlist[i]+"</option>");
//	}
	$.each($("td[stp]"),function(i,td){
		$(td).html(sendtypelist[$(td).attr("stp")]);
	});
	$.each($("td[sst]"),function(i,td){
		$(td).html(sendstatlist[$(td).attr("sst")]);
	});
	initQueryForm();
});
function delall(){
	var $ck=$(".ck:checked");
	if($ck.length>0){
		if(confirm("确定要删除此条数据？")==true){
			$.ajax({url:path+"/message/delete",data:$("#form1").serialize(),dataType:'json',success:function(msg){
				if(msg.stat=='S')
				middelbodyReload();
				showTip(msg.msg,null,1);
			}});
		}
	}else{
		alert("未选择数据！");
	}
}
function show(id){
	mbloadPage("/message/show/"+id,null,"查看通知信息");
}
</script>
<form id="form1" action="${path }/message/list" method="post" onsubmit="return pageSeach(this);">
<c:set var="formId" value="form1"/>
标题<input type="text" name="title" value="${title }">
<select name="sendtype" val="${sendtype}" id="sendtype"></select>
<%--<select name="send" val="${send}" id="sendstat"></select>--%>
<button type="submit"">查询</button>
<table class="listtable" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td colspan="100%" style="font-weight:bold;">
<button onclick="delall();" type="button">删除</button>
</td>
</tr>
<tr>
<th><label><input type="checkbox" for="ck" onclick="checkall(this);">全选</label></th>
<th>标题</th>
<th>时间</th>
<th>类型</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.data }" var="item" varStatus="stat">
<tr>
<td><input type="checkbox" name="ids" value="${item.id}" class="ck"></td>
<td><a href="javascript:show(${item.id});"<c:if test="${item.looked==0 }">class="nolooked"</c:if>>${item.title}</a></td>
<td>${item.sendtime}</td>
<td stp="${item.sendtype}"></td>
<td sst="${item.send}"></td>
</tr>
</c:forEach>
</tbody>
<tfoot>
<tr>
<td colspan="100%">
<%@include file="/inc/page.jsp" %>
</td>
</tr>
</tfoot>
</table>
</form>
